<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.linenumber {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='linenumber'>  1</span> <span class="COMM">/*loader
<span class='linenumber'>  2</span>  The 2112Portals JS Loader:
<span class='linenumber'>  3</span>  -encapsulating the loader functionality to be able to substitute it by different frameworks
<span class='linenumber'>  4</span>  -Maximum control
<span class='linenumber'>  5</span>  -Most flexible
<span class='linenumber'>  6</span>  A snapIn needs to have a load function to be hooked up by the portal system.
<span class='linenumber'>  7</span> 
<span class='linenumber'>  8</span> */</span><span class="WHIT">
<span class='linenumber'>  9</span> 
<span class='linenumber'> 10</span> 
<span class='linenumber'> 11</span> 
<span class='linenumber'> 12</span> 
<span class='linenumber'> 13</span> </span><span class="COMM">//alert(runIsolated) ;</span><span class="WHIT">
<span class='linenumber'> 14</span> </span><span class="NAME">window.NS2112</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">window.NS2112</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 15</span> 
<span class='linenumber'> 16</span> 
<span class='linenumber'> 17</span> </span><span class="NAME">NS2112.namespace</span><span class="PUNC">(</span><span class="STRN">"INTRINSICS"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 18</span> 
<span class='linenumber'> 19</span> </span><span class="NAME">NS2112.INTRINSICS.LoaderData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">strName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strType</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strPath</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strFullPath</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'> 20</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 21</span> 
<span class='linenumber'> 22</span> </span><span class="WHIT">   </span><span class="NAME">this.name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">strName</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 23</span> </span><span class="WHIT">   </span><span class="NAME">this.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">strType</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 24</span> </span><span class="WHIT">   </span><span class="NAME">this.path</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">strPath</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 25</span> </span><span class="WHIT">   </span><span class="NAME">this.fullpath</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">strFullPath</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 26</span> 
<span class='linenumber'> 27</span> </span><span class="COMM">/*
<span class='linenumber'> 28</span> name: 
<span class='linenumber'> 29</span> required, the component name 
<span class='linenumber'> 30</span> type: 
<span class='linenumber'> 31</span> required, the component type (js or css) 
<span class='linenumber'> 32</span> path: 
<span class='linenumber'> 33</span> required, the path to the script from "base" 
<span class='linenumber'> 34</span> requires: 
<span class='linenumber'> 35</span> the modules required by this component 
<span class='linenumber'> 36</span> optional: 
<span class='linenumber'> 37</span> the optional modules for this component 
<span class='linenumber'> 38</span> supersedes: 
<span class='linenumber'> 39</span> the modules this component replaces 
<span class='linenumber'> 40</span> rollup: 
<span class='linenumber'> 41</span> the number of superseded modules required for automatic rollup 
<span class='linenumber'> 42</span> fullpath: 
<span class='linenumber'> 43</span> If fullpath is specified, this is used instead of the configured base + path 
<span class='linenumber'> 44</span> skinnable: 
<span class='linenumber'> 45</span> flag to determine if skin assets should automatically be pulled in 
<span class='linenumber'> 46</span> */</span><span class="WHIT">
<span class='linenumber'> 47</span> 
<span class='linenumber'> 48</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 49</span> 
<span class='linenumber'> 50</span> </span><span class="NAME">NS2112.LoaderFactory12</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">strBaseURI</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'> 51</span> </span><span class="PUNC">{</span><span class="WHIT">        </span><span class="WHIT">
<span class='linenumber'> 52</span> </span><span class="WHIT">   </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">m_rModules</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 53</span> </span><span class="WHIT">   </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">m_baseURI</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">strBaseURI</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 54</span> </span><span class="WHIT">   </span><span class="NAME">this.loaderCallback</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 55</span> </span><span class="WHIT">      </span><span class="COMM">//o.data.mc.postRegisterSnap(o.data.theSnap, o.data.strSnapID) ;     </span><span class="WHIT">
<span class='linenumber'> 56</span> </span><span class="WHIT">     </span><span class="COMM">// alert('loaderCallback success') ;</span><span class="WHIT">
<span class='linenumber'> 57</span> </span><span class="WHIT">      </span><span class="NAME">this.loadNext</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 58</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 59</span> </span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'> 60</span> </span><span class="WHIT">   </span><span class="NAME">this.loadNext</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 61</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 62</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'> 63</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">m_rModules.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'> 64</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'> 65</span> </span><span class="WHIT">         </span><span class="NAME">this.loadModule</span><span class="PUNC">(</span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">m_rModules</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">m_rModules</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 66</span> </span><span class="WHIT">         </span><span class="NAME">m_rModules.splice</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 67</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 68</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 69</span> 
<span class='linenumber'> 70</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'> 71</span> </span><span class="WHIT">   </span><span class="NAME">this.loadModule</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">oMC</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strModuleName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strModuleURL</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 72</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 73</span> </span><span class="WHIT">       </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">Loader</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">YAHOO.util.YUILoader</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 74</span> </span><span class="WHIT">           </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'> 75</span> </span><span class="WHIT">           </span><span class="NAME">onFailure</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 76</span> </span><span class="WHIT">            </span><span class="NAME">alert</span><span class="PUNC">(</span><span class="STRN">"error: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">YAHOO.lang.dump</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 77</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 78</span> 
<span class='linenumber'> 79</span> </span><span class="WHIT">     </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 80</span> </span><span class="WHIT">     </span><span class="WHIT">
<span class='linenumber'> 81</span> </span><span class="WHIT">     </span><span class="NAME">Loader.data</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Object</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 82</span> </span><span class="WHIT">     </span><span class="NAME">Loader.data</span><span class="PUNC">[</span><span class="STRN">"test"</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'TEST'</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 83</span> </span><span class="WHIT">     </span><span class="NAME">Loader.data</span><span class="PUNC">[</span><span class="STRN">"mc"</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">oMC</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 84</span> </span><span class="WHIT">     </span><span class="NAME">Loader.onSuccess</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.loaderCallback</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 85</span> </span><span class="WHIT">     </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">ld</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">NS2112.INTRINSICS.LoaderData</span><span class="PUNC">(</span><span class="NAME">strModuleName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'js'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strModuleURL</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 86</span> </span><span class="WHIT">     </span><span class="NAME">Loader.addModule</span><span class="PUNC">(</span><span class="NAME">ld</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 87</span> </span><span class="WHIT">     </span><span class="NAME">Loader.require</span><span class="PUNC">(</span><span class="NAME">strModuleName</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//include the new  module</span><span class="WHIT">
<span class='linenumber'> 88</span> </span><span class="WHIT">     </span><span class="NAME">Loader.insert</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 89</span> </span><span class="WHIT">        </span><span class="NAME">onSuccess</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.loaderCallback</span><span class="WHIT">
<span class='linenumber'> 90</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 91</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'> 92</span> 
<span class='linenumber'> 93</span> </span><span class="WHIT">   </span><span class="NAME">this.loadModules</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">rModules</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'> 94</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 95</span> </span><span class="WHIT">      </span><span class="NAME">m_rModules</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">rModules</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 96</span> </span><span class="WHIT">      </span><span class="NAME">this.loadNext</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 97</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 98</span> 
<span class='linenumber'> 99</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>100</span> 
<span class='linenumber'>101</span> 
<span class='linenumber'>102</span> 
<span class='linenumber'>103</span> 
<span class='linenumber'>104</span> </span></pre></body></html>